/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package shared;

import java.io.Serializable;
import java.util.ArrayList;

/**
 *
 * @author latata_2
 */
public class GameInfo implements Serializable {

    private ArrayList<PlayerInfo> playersInfo;
    private String whoseTurnLogin;
    private Card topCard;
    private int demandCardType = 0;
    private int demandCardSuit = 0;
    private int cardsToTake = 0;
    private int turnToWait = 0;
    
    public GameInfo(ArrayList<PlayerInfo> playersInfo, String whoseTurnLogin, Card topCard) {
        this.playersInfo = playersInfo;
        this.whoseTurnLogin = whoseTurnLogin;
        this.topCard = new Card(topCard.getSuit(), topCard.getType());
        this.demandCardType = 0;
        this.demandCardSuit = 0;
        this.cardsToTake = 0;
        this.turnToWait = 0;
    }
    
    public GameInfo(ArrayList<PlayerInfo> playersInfo, String whoseTurnLogin, Card topCard, 
            int demandCardType, int demandCardSuit, int cardsToTake, int turnToWait) {
        this.playersInfo = playersInfo;
        this.whoseTurnLogin = whoseTurnLogin;
        this.topCard = new Card(topCard.getSuit(), topCard.getType());
        this.demandCardType = demandCardType;
        this.demandCardSuit = demandCardSuit;
        this.cardsToTake = cardsToTake;
        this.turnToWait = turnToWait;
    }

    public ArrayList<PlayerInfo> getPlayersInfo() {
        return playersInfo;
    }

    public String getWhoseTurnLogin() {
        return whoseTurnLogin;
    }

    public Card getTopCard() {
        return topCard;
    }

    public int getDemandCardType() {
        return demandCardType;
    }

    public int getDemandCardSuit() {
        return demandCardSuit;
    }

    public int getCardsToTake() {
        return cardsToTake;
    }

    public int getTurnToWait() {
        return turnToWait;
    }

    @Override
    public String toString() {
        String s;
        s = "whoseTurnLogin = " + whoseTurnLogin;
        String playersString = "";
        for (PlayerInfo p : playersInfo) {
            playersString = playersString + "\n" + p.getLogin();
        }
        s = s + "\n\n" + topCard.toString() + "\n\n" + playersString;
        return s;
    }
}